#pragma once


#include "Widgets/RectangleWidget.h"
#include "Widgets/Positioners/VerticalPositionerWidget.h"
#include "Widgets/ScrollBar.h"
#include "ListWidget.m.h"

RCLASS()
class WHENGINE_API RListWidget: public RRectangleWidget
{
    ROBJECT
public:

    RListWidget();


    RVerticalPositionerWidgetPtr GetContentContainer()
    {
        return ContentPositioner;
    }

    void ScrollTo(float Percent);
    void ScrollToTop();
    void ScrollToBottom();

    //scroll to widget, if widget is not in list, do nothing
    void ScrollToWidget(RWidgetPtr Widget);

protected:
    TWeakObjectPtr<RVerticalPositionerWidget> ContentPositioner;
    void OnContentLengthChanged();     

    TWeakObjectPtr<RScrollBar> ScrollBar;
    //void OnScrollbarDragged(float Percent);  
};